package com.cetc.sdp.kmga.cs.stream;

import com.cetc.sdp.kmga.cs.device.DeviceExpCheck;
import com.cetc.sdp.kmga.cs.device.DeviceExpCode;
import com.cetc.sdp.kmga.cs.device.DeviceState;
import com.cetc.sdp.kmga.cs.device.StateLog;
import com.esotericsoftware.kryo.Kryo;
import com.esotericsoftware.kryo.serializers.FieldSerializer;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.spark.serializer.KryoRegistrator;
import scala.Tuple2;

/**
 * @description:
 * @author： DengQiang
 * @date: 2017/10/10 15:06
 */
public class StateKryoRegistrator implements KryoRegistrator {

    @Override
    public void registerClasses(Kryo kryo) {
        kryo.register(DeviceExpCheck.class, new FieldSerializer(kryo, DeviceExpCheck.class));
        kryo.register(DeviceExpCode.class, new FieldSerializer(kryo, DeviceExpCode.class));
        kryo.register(DeviceState.class, new FieldSerializer(kryo, DeviceState.class));
        kryo.register(StateLog.class, new FieldSerializer(kryo, StateLog.class));
//        kryo.register(Tuple2.class, new FieldSerializer(kryo, Tuple2.class));
//        kryo.register(ConsumerRecord.class, new FieldSerializer(kryo, ConsumerRecord.class));
    }
}
